<?php
	/*
		Created by using  the User_Login page as a template

		Created by			:	Daniel Ramsdell
		Created On			:	29.August.2011
		Last Modification	:	Add class, create table using query_table fuction
		Modified On			:	06.September.2011
		Modified By			:	Daniel Ramsdell
	*/




	//include the functions.php
	require "include/functions.php";

	check_session();
	check_admin();
?>

<html>
<head>
<title>Home Electronics - Stock Level</title>
<link rel="stylesheet" href="include/styles.css" type="text/css">
<script src="include/functions.js"></script>
<script>window.onload=function(){
	altRows('alternatecolor');
}</script>
</head>
<body>
<div id="container" align="center">
  	
	<div id="body" align="center">
		<div>
	<?php
		print('

			<h1>Stock Level</h1> 
			<a>');
			
		$table_rows = array("product_id", "product_name", "quantity_in_stock", "minimum_stock_level", "category");
		//	echo table headders
		echo("<table class='altrowstable' id='alternatecolor'><tr><th>ID</th><th>Product Name</th><th>Stock</th><th>Min Stock</th><th>Category</th></tr>");
		//	get data from database and print to screen
		$result = query_table("home_electronics", "home", "home_e", "product", $table_rows, null, false, false);
		echo($result."</table></a>");
		
		
	?>
		
		</div>
	</div> <!--body div -->
</div>
</body>
</html>




